import { USERINFO } from '@/store/reducer/user/axtionTypes';
import type { UserType } from '@/types/user';

const initialState = {
  userInfo: {
    avatar: '',
    userName: '',
    name: '',
    id: '',
  },
};

const User = (state = initialState, action: { type: string; userInfo: UserType }) => {
  switch (action.type) {
    case USERINFO:
      return { ...state, userInfo: action.userInfo };
    default:
      return state;
  }
};

export { User };
